﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MaBlaApp.Data;

public class TodoService
{
    public readonly List<TodoItem> TodoItems = new List<TodoItem>();

    public TodoService()
    {
        for (int i = 1; i <= 20; i++)
        {
            var item = new TodoItem()
            {
                Id = i,
                Title = $"任务{i:00}",
                Description = $"学习MAUI系列-{i:00}",
                CreatedDate = (new DateTime(2023, 1, 1)).AddDays(i),
                Priority = (TodoPriority)(i % 3),
                IsFinished = false,
            };

            TodoItems.Add(item);
        }
    }

    public void AddTodo(TodoItem item)
    {
        TodoItems.Add(item);
    }
}
